$ cd lab

$ ./run.sh

Usage: ./run.sh deploy | teardown | rebuild | cleanup | status

deploy | build images and start containers

teardown | stop containers

rebuild | rebuilds the lab from scratch

cleanup | stop containers and delete containers and images

status | check the status of the lab

Lets start by creating the lab by using the deploy argument. Note that when

you execute the deployment, you’ll be prompted for your kali user password:

$ ./run.sh deploy

The initial deployment of the lab environment will take a few minutes to

complete. To monitor the progress of the installation, youll need to open a new

terminal session and tail the log file located within the repositorys lab directory,

as so:

$ tail -f ~/Black-Hat-Bash/lab/log.txt

When the tail -f (follow) command is used against a file, it provides a

live view of any new lines added to the end of the file. This is useful for keeping

an eye on log files, which frequently have new information written to them.

N O T E

Because the lab setup downloads software such as operating system images and

other applications, this deployment could take some time, depending on the network

connection you have and the compute resources allocated to the host running the lab.

Testing and Verifying the Containers

Once the log file indicates the process is complete, it should tell you whether

the lab was set up correctly. We can also run a few commands to verify this. First,

lets execute a status check using the run.sh script, this time with the status

argument. If all the checks pass, you should get the following output:

$ ./run.sh status

Lab is up.

We can also list all our labs running Docker containers using the docker

list command:

$ docker ps -format "{{.Names}}"

p-web-01

p-web-02

p-ftp-01

c-jumpbox-01

c-db-01

c-db-02

c-syslog-01

c-backup-01

c-redis-01

Black Hat Bash (Early Access) © 2023 by Dolev Farhi and Nick Aleks